package com.fqy.ticket.batch.config;

import org.mybatis.spring.annotation.MapperScan;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.cloud.openfeign.EnableFeignClients;
import org.springframework.context.annotation.ComponentScan;
import org.springframework.core.env.Environment;

@SpringBootApplication
@ComponentScan("com.fqy")
@MapperScan("com.fqy.ticket.batch.mapper")
@EnableFeignClients("com.fqy.ticket.batch.feign")
public class BatchApplication {
    //把logger和MemberApplication绑定，打印时会显示MemberApplication信息，用去区分不同的启动类
    private static final Logger LOG = LoggerFactory.getLogger(BatchApplication.class);
    public static void main(String[] args) {

        SpringApplication app = new SpringApplication(BatchApplication.class);
        // 启动并获取当前环境变量，包括properties文件内容，及其他自动配置的参数信息
        Environment env = app.run(args).getEnvironment();
        LOG.info("启动成功！！！");
        LOG.info("测试地址: \thttp://127.0.0.1:{}{}/hello ", env.getProperty("server.port"), env.getProperty("server.servlet.context-path"));
    }
}
